package config

import "github.com/spf13/viper"

var config *viper.Viper

// 初始化配置
func SetupConfig(filename string) {
	config = viper.New()
	config.SetConfigFile(filename)
	config.SetConfigType("yaml")
	if err := config.ReadInConfig(); err != nil {
		panic(err.Error())
	}
}

// 获取默认配置
func Defalut() *viper.Viper {
	return config
}
